package com.albaba.designpattern.iterator.text_002;

/**
 * @Description: TODO
 * @Author zx
 * @Date 2025/2/25 17:17
 * @Version 1.0
 */
public class Client {
    public static void main(String[] args) {
        Topic[] topics = new Topic[4];
        topics[0] = new Topic("topic1");
        topics[1] = new Topic("topic2");
        topics[2] = new Topic("topic3");
        topics[3] = new Topic("topic4");

        TopicList topicList = new TopicList(topics);
        IteratorIterator<Topic> iterator = topicList.iterator();

        while (iterator.hasNext()){
            Topic next = iterator.next();
            System.out.println(next.getName());
        }

    }
}
